Commands for medium changer devices RELEASE command (media changer) Parameters for medium changer devices
SCSI-2

17.2.8 RESERVE command (media changer)

The RESERVE command (see table 343) is used to reserve units or, if the element reservation option is implemented, elements within units for the use of the initiator. The third-party reservation allows units or elements to be reserved for another specified SCSI device. The RESERVE and RELEASE commands provide the basic mechanism for contention resolution in multiple-initiator systems.

Table 343 - RESERVE command

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                           Operation code (16h)                        |
|-----------------------------------------------------------------------------|
| 1   | Logical unit number      | 3rdPty | Third party device ID    | Element|
|-----------------------------------------------------------------------------|
| 2   |                           Reservation identification                  |
|-----------------------------------------------------------------------------|
| 3   | (MSB)                                                                 |
|---------                        Element list length                      ---|
| 4   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 5   |                           Control                                     |
===============================================================================
17.2.8.1 Logical unit reservation

If the element bit is zero, this command shall request that the entire unit be reserved for the exclusive use of the initiator until the reservation is superseded by another valid RESERVE command from the initiator that made the reservation or until released by a RELEASE command from the same initiator that made the reservation, by a BUS DEVICE RESET message from any initiator, by a hard RESET condition, or by a power off/on cycle. A unit reservation shall not be granted if the unit or any element is reserved by another initiator. It shall be permissible for an initiator to reserve a unit that is currently reserved by that initiator. If the element bit is zero, the reservation identification and the element list length shall be ignored.

If the unit, or any element within the unit, is reserved for another initiator, the target shall respond by returning RESERVATION CONFLICT status.

If, after honouring the reservation, any other initiator attempts to perform any command on the reserved unit other than an INQUIRY, REQUEST SENSE, ALLOW MEDIUM REMOVAL, RESERVE, or a RELEASE command, the command shall be rejected with RESERVATION CONFLICT status.

17.2.8.2 Element reservation (optional)

The reservation identification provides a means for an initiator to identify each element reservation. This allows an initiator in a multiple-tasking environment, to have multiple reservations outstanding. The reservation identification is used in the RELEASE command to specify which reservation is to be released. It is also used in superseding RESERVE commands to specify which reservation is to be superseded.

If the element reservation option is implemented, the element release option (see 17.2.7.2) shall also be implemented. These options permit multiple elements within the unit to be reserved, each with a separate reservation identification.

If the element bit is one, and the element reservation option is implemented, the target shall process the reservation request as follows:

  1. The element list shall be checked for valid element addresses. If any element address is invalid for this unit, the command shall be terminated with CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST. The element list shall be checked for invalid element overlaps with other element descriptors in the element list and if invalid overlaps are found, the command shall be terminated with CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST.
  2. If the requested reservation does not conflict with any active or previously requested reservation, the elements specified shall be reserved until superseded by another valid RESERVE command from the initiator that made the reservation, or until released by a RELEASE command from the same initiator, by a BUS DEVICE RESET message from any initiator, or by a hard RESET condition. If either of the last two conditions occur, the next command from each initiator shall be terminated with CHECK CONDITION status and the sense key shall be set to UNIT ATTENTION.
  3. If the reservation request conflicts with a reservation already active the target shall return RESERVATION CONFLICT status.

If the element bit is one, and the element reservation option is not implemented, the RESERVE command shall be terminated with CHECK CONDITION status. The sense key shall be set to ILLEGAL REQUEST.

The size of the element list shall be defined by the element list length parameter. The element list shall consist of zero or more descriptors as shown in table 344. Each element list descriptor defines a series of elements beginning at the specified element address for the specified number of elements. If the number of elements is zero, the element list shall begin at the specified element address and continue through the last element address on the unit.

Table 344 - Data format of element list descriptors

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                                                                       |
|- - -----                         Reserved                                ---|
| 1   |                                                                       |
|-----------------------------------------------------------------------------|
| 2   | (MSB)                                                                 |
|---------                        Number of elements                       ---|
| 3   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 4   | (MSB)                                                                 |
|---------                        Element address                          ---|
| 5   |                                                                 (LSB) |
===============================================================================
If an initiator issues a command to an element that has been reserved by a different initiator, the command shall not be performed and the command shall be terminated with a RESERVATION CONFLICT status. If a reservation conflict precludes any part of the command, none of the command shall be performed.

17.2.8.3 Third party reservation

The third-party reservation option of the RESERVE command allows an initiator to reserve a unit or elements within a unit for another SCSI device.

If the third-party (3rdPty) bit is zero, the third-party reservation option is not requested. If the 3rdPty bit is one and the third-party reservation option is implemented, the RESERVE command shall reserve the specified unit or elements for the SCSI device specified in the third- party device ID field. The target shall preserve the reservation until it is superseded by another valid RESERVE command from the initiator that made the reservation or until it is released by the same initiator, by a BUS DEVICE RESET message from any initiator, or a hard RESET condition. The target shall ignore any attempt to release the reservation made by any other initiator.

If the 3rdPty bit is one and the third-party reservation option is not implemented, the target shall reject the RESERVE command with CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST.

17.2.8.4 Superseding reservations

An initiator that holds a current reservation may modify that reservation by issuing another RESERVE command to the same unit and, if the element bit is one, using the same reservation identification. The superseding RESERVE command shall release the previous reservation in place when the new reservation request is granted. The current reservation shall not be modified if the new reservation request cannot be granted. If the superseding reservation cannot be granted because of conflicts with a previous active reservation (other than the reservation being superseded), the target shall return RESERVATION CONFLICT status.

( Superseding reservations are principally intended to allow the SCSI device ID to be changed on a reservation using the third- party reservation option. )

17.2.9 SEND VOLUME TAG command

The SEND VOLUME TAG command (see table 345) transfers a volume tag template to be searched for or new volume tag information for one or more media changer elements. The function of the command is conveyed by the send action code field. The REQUEST VOLUME ELEMENT ADDRESS command is used to transfer the results of a translate search operation.

Table 345 - SEND VOLUME TAG command

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                           Operation code (B6h)                        |
|-----------------------------------------------------------------------------|
| 1   | Logical unit number      |Reserved|        Element type code          |
|-----------------------------------------------------------------------------|
| 2   | (MSB)                                                                 |
|---------                        Element address                          ---|
| 3   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 5   |          Reserved        |              Send action code              |
|-----------------------------------------------------------------------------|
| 6   |                                                                       |
|---------                        Reserved                                 ---|
| 7   |                                                                       |
|-----------------------------------------------------------------------------|
| 8   | (MSB)                                                                 |
|---------                     Parameter list length                       ---|
| 9   |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
|10   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
|11   |                           Control                                     |
===============================================================================
The element type code field specifies an element type specification as defined in 17.2.5. If the send action code indicates a translate operation, this field indicates the element types to be searched. If this is a zero, all element types are candidates for a translate operation. If the send action code does not indicate a translate, this field shall be treated as reserved.

The send action code field gives the function to be performed by this command as listed in table 346.

Table 346 - Send volume tag action codes

===============================================================================
|    Code     |  Description                                                  |
|-----------------------------------------------------------------------------|
|      0h     |  Translate - search all defined volume tags                   |
|      1h     |  Translate - search only primary volume tags                  |
|      2h     |  Translate - search only alternate volume tags                |
|      3h     |  Reserved                                                     |
|      4h     |  Translate - search all defined tags - ignore sequence numbers|
|      5h     |  Translate - search primary tags - ignore sequence numbers    |
|      6h     |  Translate - search alternate tags - ignore sequence numbers  |
|      7h     |  Reserved                                                     |
|      8h     |  Assert - as the primary volume tag - if tag now undefined    |
|      9h     |  Assert - as the alternate volume tag - if tag now undefined  |
|      Ah     |  Replace - the primary volume tag - current tag ignored       |
|      Bh     |  Replace - the alternate volume tag - current tag ignored     |
|      Ch     |  Undefined - the primary volume tag - current tag ignored     |
|      Dh     |  Undefined - the alternate volume tag - current tag ignored   |
|   Eh - 1Bh  |  Reserved                                                     |
|  1Ch - 1Fh  |  Vendor-specific                                              |
===============================================================================
Translate operations request that the target search the volume tag information available to it for elements whose volume tag information matches the template given by the command parameters. The resulting information is reported via the REQUEST VOLUME ELEMENT ADDRESS command.

Assert operations define volume tag information for a single element. A CHECK CONDITION with ILLEGAL REQUEST is reported if the subject element already has defined volume tag information; in this case, the original volume tag information shall remain unaltered.

Replace operations define volume tag information for a single element. Any previously defined volume tag information is overwritten.

Undefined operations cause previously defined volume tag information for the specified element to be cleared. It shall not be considered an error to undefined volume tag information that was not previously defined.

A medium changer device that implements volume tag information may choose to not implement the facilities that modify the volume tag information. With such an implementation a request for the assert, replace or undefined functions would cause the SEND VOLUME TAG command to be terminated with CHECK CONDITION and a sense key of ILLEGAL REQUEST.

The element address field gives a medium changer element address whose interpretation depends on the send action code received with this command. When the send action code is a translate, (code values 0h .. 7h), the element address field gives the starting element to be examined for satisfaction of the search criteria. When the send action code is other than translate, (i.e. assert, replace, and undefined, code values 8h .. Dh), the element address field gives the particular element whose volume tag information is to be modified.

The volume tag information used for translate, assert and replace functions is defined in table 347. No parameters are necessary for undefined operations.

Table 347 - Send volume tag parameters format

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                                                                       |
|- - -----               Volume identification template field              ---|
| 31  |                                                                       |
|-----------------------------------------------------------------------------|
| 32  |                                                                       |
|---------                            Reserved                             ---|
| 33  |                                                                       |
|-----------------------------------------------------------------------------|
| 34  | (MSB)                                                                 |
|- - -----                  Minimum volume sequence number                 ---|
| 35  |                                                                 (LSB) |
|-----------------------------------------------------------------------------|
| 36  |                                                                       |
|---------                            Reserved                             ---|
| 37  |                                                                       |
|-----------------------------------------------------------------------------|
| 38  | (MSB)                                                                 |
|- - -----                  Maximum volume sequence number                 ---|
| 39  |                                                                 (LSB) |
===============================================================================
The volume identification template field specifies a search template for translate functions and the exact value of the new volume identification information for other SEND VOLUME TAG command functions.

As a search template, this field may contain the wildcard characters '*' and '?' (2Ah and 3Fh). '*' will match any string of characters, when it appears in a template the remainder of the template is not used. '?' will match any single character.

For a function other than translate, this field may not contain the '*' or '?' wildcard characters.

The minimum volume sequence number field specifies the new sequence number for the assert and replace functions. For a translate, this specifies the least value that will meet the search specification.

The maximum volume sequence number field specifies the greatest value that will meet the search specification. This field is ignored on functions other than translate.